import cn.edu.zju.ops.service.ResetService;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * 容器测试器
 *
 * @author tjq
 * @since 2020/6/29
 */
public class ContainerTester {

    private static final String CONTEXT_CONFIG = "classpath*:oms-worker-container-spring-context.xml";
    private static ClassPathXmlApplicationContext container;
    private static ResetService resetService;

    @BeforeAll
    public static void initContainer() {
        container = new ClassPathXmlApplicationContext(new String[]{CONTEXT_CONFIG}, true);
        resetService = container.getBean(ResetService.class);
    }

    @Test
    public void testResetAppName() {
        resetService.resetAppName();
    }

    @Test
    public void testResetJobs() {
        resetService.resetJobs();
    }

    @Test
    public void testResetContainer() {
        resetService.resetContainer("aaa");
    }

    @Test
    public void testResetWorkflow() {
        resetService.resetWorkflow();
    }

}
